﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'GetEmpleadosByKeyWord')
	BEGIN
		DROP  Procedure  GetEmpleadosByKeyWord
	END

GO

CREATE Procedure GetEmpleadosByKeyWord

	(
		@dni varchar(8),
		@nombre nvarchar(50),
		@apellidos nvarchar(80)
	)

AS

BEGIN
	SET NOCOUNT ON
	
	SELECT
	[Apellidos],
	[Direccion],
	[DNI],
	[Email],
	[IdCargo],
	[IdEmpleado],
	[Nombre],
	[Telefono]
	FROM [Empleados] 
	WHERE [DNI] LIKE (@dni + '%') AND
	[Nombre] LIKE (@nombre + '%') AND
	[Apellidos] LIKE (@apellidos + '%')

	SET NOCOUNT OFF
END

GO


GRANT EXEC ON GetEmpleadosByKeyWord TO PUBLIC

GO


